//@ sourceURL=inverstAlign.js
CommonUtils.regNamespace("com.im.inverstAlign");
com.im.inverstAlign.invoke = function() {
    var param = {
        pageNumber: 1,
        pageSize: 20
    };
    var client = new com.im.common.ajax();
    var operType = "";
    var inverstFirstTrial;
    var bu_first,sheng_first,zheng_first,qi_first,shi_first,other_first,total_first;

    function _init() {
        //复选框
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass   : 'iradio_minimal-blue'
        });
        //下拉框
        $('.select2').select2();
        //查询投资计划批次
        _initInvestBatch();
        //加载列表信息
        _initDataList(1, 20);
        //重置按钮
        $('#ResetBtn').click(function (){
            _resetSearchInfo();
        });
        //查询按钮
        $("#SearchBtn").click(function(){
            _initDataList(1, 20);
        });
        //保存按钮
        $("#saveBtn").click(function(){
            _saveinverstFirstTrial();
        });
        //新增
        $("#GreenBtn").click(function () {
            _greenInvers();
        });
        var statusCdList=[{"id":"60","text":"通过"},{"id":"50","text":"不同意"}];
        var statusCdSelect = $("#examineResult");
        var statusCdSelect2 = $("#examineResult2");
        $.each(statusCdList, function (i, item) {
            if(i == 0) {
                statusCdSelect.append("<option statusCdId='" + item.id + "' selected='selected'>" + item.text + "</option>");
                statusCdSelect2.append("<option statusCdId='" + item.id + "' selected='selected'>" + item.text + "</option>");
            } else {
                statusCdSelect.append("<option statusCdId='" + item.id + "'>" + item.text + "</option>");
                statusCdSelect2.append("<option statusCdId='" + item.id + "'>" + item.text + "</option>");
            }
        });
        //查询条件联动
        $("#searchOrgName").project2unit2itemCommpent({
            elmIdPlanTypeSel : "",
            elmIdUnitSel : "searchOrgName",//组织单位下拉元素
            elmIdItemSel : "searchImpleProjName",//实施项目下拉元素
            orgType : "10",//初始化单位时，单位类型
            callbackFunc: function (callBackType, ret) {//下拉框值改变时回调
                _initDataList(1, 20);
            }
        });
        $("#orgName").project2unit2itemCommpent({
            elmIdPlanTypeSel : "",
            elmIdUnitSel : "orgName",//组织单位下拉元素
            elmIdItemSel : "impleProjName",//实施项目下拉元素
            orgType : "10",//初始化单位时，单位类型
            callbackFunc: function (callBackType, ret) {//下拉框值改变时回调
                if(callBackType == 3) {
                    _qryGreenInver2();
                }
            }
        });
        //批量批复
        $('#batchTrial').click(function (){
            if($('#inverstFirstTrialList').datagrid('getChecked').length == 0) {
                com.im.common.confirm("请选择项目", null, function () {
                    return;
                });
            } else {
                $("#batchEditModal").modal("show");
            }
        });
        //保存按钮
        $("#saveBtn2").click(function(){
            _saveinverstFirstTrial2();
        });
        $("#saveBtnGreen").click(function(){
            _saveBtnGreen();
        });
        $("#investBatch").on("change",function(){
            _initDataList(1, 20);
        });
        //关闭弹框清楚资金数据
        $('#addEditModal').on('hidden.bs.modal', function () {
            $('#addEditModal .money_comptemt input.form-control').val('');
        });
        //计算总计
        $("#bu_end").keyup(function () {
            _initTotal();
        });
        $("#sheng_end").keyup(function () {
            _initTotal();
        });
        $("#zheng_end").keyup(function () {
            _initTotal();
        });
        $("#qi_end").keyup(function () {
            _initTotal();
        });
        $("#shi_end").keyup(function () {
            _initTotal();
        });
        $("#other_end").keyup(function () {
            _initTotal();
        });
    };
    function _initTotal() {
        var b = $("#bu_end").val();
        var s = $("#sheng_end").val();
        var g = $("#zheng_end").val();
        var q = $("#qi_end").val();
        var sh = $("#shi_end").val();
        var o= $("#other_end").val();

        var tmp = 0;
        if(b != ''){
            tmp = tmp + parseFloat(b);
        }
        if(s != ''){
            tmp = tmp + parseFloat(s);
        }
        if(g != ''){
            tmp = tmp + parseFloat(g);
        }
        if(q != ''){
            tmp = tmp + parseFloat(q);
        }
        if(sh != ''){
            tmp = tmp + parseFloat(sh);
        }
        if(o != ''){
            tmp = tmp + parseFloat(o);
        }
        $("#total_end").val(tmp.toFixed(2));
    }

    //查询投资计划批次
    function _initInvestBatch() {
        var req = {};
        req.declareType = 10;
        req.hasYearDt = 'Y';
        var resp = client.callAsJson("investPlanService/queryDeclareSetIds", req);
        var investBatch = $("#investBatch");
        var investBatch2 = $("#investBatch2");
        $.each(resp.result, function (i, item) {
            if(i == 0) {
                investBatch.append("<option value='' declareSetId='" + item.declareSetId + "' year='" + item.yearDt + "' selected='selected'>" + item.declareCode + "</option>");
                investBatch2.append("<option value='' declareSetId='" + item.declareSetId + "' year='" + item.yearDt + "' selected='selected'>" + item.declareCode + "</option>");
            } else {
                investBatch.append("<option declareSetId='" + item.declareSetId + "' year='" + item.yearDt + "'>" + item.declareCode + "</option>");
                investBatch2.append("<option declareSetId='" + item.declareSetId + "' year='" + item.yearDt + "'>" + item.declareCode + "</option>");
            }
        });
    }

    //重置搜索条件
    function _resetSearchInfo(){
        $('#investBatch').val("").trigger("change");
        $('#searchOrgName').val("").trigger("change");
        $('#searchImpleProjName').val("").trigger("change");
    }

    //审核(保存按钮)
    function _saveinverstFirstTrial(){
        var saveparam={};
        saveparam.fundSourceBu= $("#bu_end").val();
        saveparam.fundSourceSheng= $("#sheng_end").val();
        saveparam.fundSourceGao= $("#zheng_end").val();
        saveparam.fundSourceQi= $("#qi_end").val();
        saveparam.fundSourceShi= $("#shi_end").val();
        saveparam.fundSourceOther= $("#other_end").val();
//        if(bu_first!= $("#bu_first").val() ||sheng_first!=$("#sheng_first").val()||zheng_first!=$("#zheng_first").val()||qi_first!=$("#qi_first").val()||shi_first!=$("#shi_first").val())
//            saveparam.operType="1";
        saveparam.examineDescription= $("#examineDescription").val();
        saveparam.investPlanId= $("#investPlanId").val();
        if($("#examineResult").val()=="通过")
            saveparam.statusCd=60 ;
        if($("#examineResult").val()=="不通过")
            saveparam.statusCd=50 ;
        var result = client.callAsJson("investPlanService/trialInvestPlan", saveparam);
        if(result.resultCode=='0'){
            $("#addEditModal").modal("hide");
            toastr.success("保存成功！");
            _initDataList(1, 20);
        }else {
            toastr.error("服务器忙！请稍后再试！"+result.resultMsg);
        }
    }

    function _greenInvers(){
        $("#addEditModal").modal("show");
        $("#saveBtnGreen").show();
        $("#saveBtn").hide();
        $('#investBatch2').val($('#investBatch2 option:eq(0)').attr('declaresetid')).trigger("change").attr('disabled',false);
        $('#orgName').val($('#orgName option:eq(1)').attr('value')).trigger("change").attr('disabled',false);
        $('#impleProjName').val($('#impleProjName option:eq(1)').attr('value')).trigger("change").attr('disabled',false);
    };

    function _qryGreenInver2() {
        var projId = $("#impleProjName option:selected").attr("value");
        var devOrg = $("#orgName option:selected").attr("value");
        var setId = $("#investBatch2 option:selected").attr("declareSetId");
        if (projId == "") {
            toastr.warning("项目不能为空");
            return;
        }
        if (devOrg == "") {
            toastr.warning("建设单位不能为空");
            return;
        }
        if (setId == "") {
            toastr.warning("申报批次不能为空");
            return;
        }
        var params = {
            impleProjId :projId,
            developOrg : devOrg,
            declareSetId : setId
        };
        var resp = client.callAsJson("investPlanService/queryInvestPlanForGreen", params);

        if (!resp.success) {
            toastr.error(resp.resultMsg);
            return;
        }

        $.each(resp.result.fundDetailVo, function (j, two) {
            if(two.type == "planProjMoney") {
                $("#bu_plan").val(two.fundBu);
                $("#sheng_plan").val(two.fundSheng);
                $("#zheng_plan").val(two.fundGao);
                $("#qi_plan").val(two.fundQi);
                $("#shi_plan").val(two.fundShi);
                $("#other_plan").val(two.fundOther);
                $("#total_plan").val(two.total);

            } else if(two.type == "implProjMoney") {
                $("#bu_impl").val(two.fundBu);
                $("#sheng_impl").val(two.fundSheng);
                $("#zheng_impl").val(two.fundGao);
                $("#qi_impl").val(two.fundQi);
                $("#shi_impl").val(two.fundShi);
                $("#other_impl").val(two.fundOther);
                $("#total_impl").val(two.total);
            } else if(two.type == "investPlanMoney") {
                $("#bu_invest").val(two.fundBu);
                $("#sheng_invest").val(two.fundSheng);
                $("#zheng_invest").val(two.fundGao);
                $("#qi_invest").val(two.fundQi);
                $("#shi_invest").val(two.fundShi);
                $("#other_invest").val(two.fundOther);
                $("#total_invest").val(two.total);
            } else if(two.type == "fundPlanMoney") {
                $("#bu_fund").val(two.fundBu);
                $("#sheng_fund").val(two.fundSheng);
                $("#zheng_fund").val(two.fundGao);
                $("#qi_fund").val(two.fundQi);
                $("#shi_fund").val(two.fundShi);
                $("#other_fund").val(two.fundOther);
                $("#total_fund").val(two.total);
            }
        });


    }
    //审核操作
    function _modinverstFirstTrial(index){
        var data = $('#inverstFirstTrialList').datagrid('getData').rows[index];
        $("#investPlanId").val(data.investPlanId);
        $("#saveBtnGreen").hide();
        $("#saveBtn").show();

        $("#investBatch2").val(data.declareSetId).trigger("change").attr('disabled',true);
        $("#orgName").val(data.orgId).trigger("change").attr('disabled',true);
        $("#impleProjName").val(data.impleProjId).trigger("change").attr('disabled',true);
        $("#bu_plan").val(data.bu_plan);
        $("#sheng_plan").val(data.sheng_plan);
        $("#zheng_plan").val(data.zheng_plan);
        $("#qi_plan").val(data.qi_plan);
        $("#shi_plan").val(data.shi_plan);
        $("#other_plan").val(data.other_plan);
        $("#total_plan").val(data.total_plan);
        $("#bu_impl").val(data.bu_impl);
        $("#sheng_impl").val(data.sheng_impl);
        $("#zheng_impl").val(data.zheng_impl);
        $("#qi_impl").val(data.qi_impl);
        $("#shi_impl").val(data.shi_impl);
        $("#other_impl").val(data.other_impl);
        $("#total_impl").val(data.total_impl);
        $("#bu_invest").val(data.bu_invest);
        $("#sheng_invest").val(data.sheng_invest);
        $("#zheng_invest").val(data.zheng_invest);
        $("#qi_invest").val(data.qi_invest);
        $("#shi_invest").val(data.shi_invest);
        $("#other_invest").val(data.other_invest);
        $("#total_invest").val(data.total_invest);
        $("#bu_fund").val(data.bu_fund);
        $("#sheng_fund").val(data.sheng_fund);
        $("#zheng_fund").val(data.zheng_fund);
        $("#qi_fund").val(data.qi_fund);
        $("#shi_fund").val(data.shi_fund);
        $("#other_fund").val(data.other_fund);
        $("#total_fund").val(data.total_fund);
        $("#bu_write").val(data.bu_write);
        $("#sheng_write").val(data.sheng_write);
        $("#zheng_write").val(data.zheng_write);
        $("#qi_write").val(data.qi_write);
        $("#shi_write").val(data.shi_write);
        $("#other_write").val(data.other_write);
        $("#total_write").val(data.total_write);
        $("#bu_first").val(data.bu_first);
        $("#sheng_first").val(data.sheng_first);
        $("#zheng_first").val(data.zheng_first);
        $("#qi_first").val(data.qi_first);
        $("#shi_first").val(data.shi_first);
        $("#other_first").val(data.other_first);
        $("#total_first").val(data.total_first);
        $("#bu_end").val(data.bu_first);
        $("#sheng_end").val(data.sheng_first);
        $("#zheng_end").val(data.zheng_first);
        $("#qi_end").val(data.qi_first);
        $("#shi_end").val(data.shi_first);
        $("#other_end").val(data.other_first);
        $("#total_end").val(data.total_first);

        $("#addEditModal").modal("show");
    }
    //初始化表格数据
    function _initDataList(pageNumber, pageSize){
        var batchYear = $("#investBatch option:selected").attr("year");

        var columns=[[
            {field:'全选',title:"全选",width:30,checkbox:true,rowspan:2,fitColumns:true},
            {field:'序号',title:"序号",width:$(this).width()*0.03,fitColumns:true,rowspan:2,
                formatter: function(value,row,index){
                    return  index+1;
                }
            },
            {field:'impleProjName',title:"项目名称",width:$(this).width()*0.1,fitColumns:true,rowspan:2,align:'center'},
            {field:'orgName',title:"建设单位",width:$(this).width()*0.1,fitColumns:true,rowspan:2,align:'center'},
            {title:"建设年限",colspan:2,fitColumns:true,align:'center'},
            {field:'preWorkSituation',title:"前期工作情况",width:$(this).width()*0.1,fitColumns:true,rowspan:2,align:'center'},
            {title:"概算总投资",colspan:7,fitColumns:true,align:'center'},
            {title:"累计至" + (batchYear ) + "年下达的计划",colspan:7,fitColumns:true,align:'center'},
            {title:"累计至" + (batchYear ) + "年完成的投资",colspan:7,fitColumns:true,align:'center'},
            {title:"累计至" + (batchYear ) + "年到位的资金",colspan:7,fitColumns:true,align:'center'},
            {title: batchYear + "年填报投资计划",colspan:10,fitColumns:true,align:'center'},
            {title: batchYear + "年初审投资计划",colspan:8,fitColumns:true,align:'center'},
            {title: batchYear + "年批复投资计划",colspan:8,fitColumns:true,align:'center'},
            {field:'operation',title:"操作",width:$(this).width()*0.06,rowspan:2,
                formatter: function(value,row,index){
                    return  '<a href="javascript:; "onclick="com.im.inverstAlign.invoke.modinverstFirstTrial(\''+index+'\')" title="审核"><i class="fa fa-pencil"></i></a> ';
                }
            }],
            [	{field:'investPlanStartDt',title:"开工年",fitColumns:true},
                {field:'investPlanEndDt',title:"完工年",fitColumns:true},
                {field:'total_plan',title:"合计",fitColumns:true},
                {field:'bu_plan',title:"部补助",fitColumns:true},
                {field:'sheng_plan',title:"省财政",fitColumns:true},
                {field:'zheng_plan',title:"政府融资",fitColumns:true},
                {field:'shi_plan',title:"市州配套",fitColumns:true},
                {field:'qi_plan',title:"企业自筹",fitColumns:true},
                {field:'other_plan',title:"其它",fitColumns:true},
                {field:'total_impl',title:"合计",fitColumns:true},
                {field:'bu_impl',title:"部补助",fitColumns:true},
                {field:'sheng_impl',title:"省财政",fitColumns:true},
                {field:'zheng_impl',title:"政府融资",fitColumns:true},
                {field:'shi_impl',title:"市州配套",fitColumns:true},
                {field:'qi_impl',title:"企业自筹",fitColumns:true},
                {field:'other_impl',title:"其它",fitColumns:true},
                {field:'total_invest',title:"合计",fitColumns:true},
                {field:'bu_invest',title:"部补助",fitColumns:true},
                {field:'sheng_invest',title:"省财政",fitColumns:true},
                {field:'zheng_invest',title:"政府融资",fitColumns:true},
                {field:'shi_invest',title:"市州配套",fitColumns:true},
                {field:'qi_invest',title:"企业自筹",fitColumns:true},
                {field:'other_invest',title:"其它",fitColumns:true},
                {field:'total_fund',title:"合计",fitColumns:true},
                {field:'bu_fund',title:"部补助",fitColumns:true},
                {field:'sheng_fund',title:"省财政",fitColumns:true},
                {field:'zheng_fund',title:"政府融资",fitColumns:true},
                {field:'shi_fund',title:"市州配套",fitColumns:true},
                {field:'qi_fund',title:"企业自筹",fitColumns:true},
                {field:'other_fund',title:"其它",fitColumns:true},
                {field:'total_write',title:"合计",fitColumns:true},
                {field:'bu_write',title:"部补助",fitColumns:true},
                {field:'sheng_write',title:"省财政",fitColumns:true},
                {field:'zheng_write',title:"政府融资",fitColumns:true},
                {field:'shi_write',title:"市州配套",fitColumns:true},
                {field:'qi_write',title:"企业自筹",fitColumns:true},
                {field:'other_write',title:"其它",fitColumns:true},
//                {field:'statusCd',title:"状态",fitColumns:true},
                {field:'description',title:"备注",fitColumns:true},
                {field:'files',title:"填报附件",fitColumns:true,formatter: function(value,row,index){
                        if(value.length > 0){
                            var fileNames = "";
                            $.each(value, function (i, item) {
                                fileNames += item.attachFullName + "  ";
                            });
                            return fileNames;
                        }else {
                            return "";
                        }
                    }},

                {field:'total_first',title:"合计",fitColumns:true},
                {field:'bu_first',title:"部补助",fitColumns:true},
                {field:'sheng_first',title:"省财政",fitColumns:true},
                {field:'zheng_first',title:"政府融资",fitColumns:true},
                {field:'shi_first',title:"市州配套",fitColumns:true},
                {field:'qi_first',title:"企业自筹",fitColumns:true},
                {field:'other_first',title:"其它",fitColumns:true},
                {field:'examineDescription',title:"审核描述",fitColumns:true},

                {field:'total_end',title:"合计",fitColumns:true},
                {field:'bu_end',title:"部补助",fitColumns:true},
                {field:'sheng_end',title:"省财政",fitColumns:true},
                {field:'zheng_end',title:"政府融资",fitColumns:true},
                {field:'shi_end',title:"市州配套",fitColumns:true},
                {field:'qi_end',title:"企业自筹",fitColumns:true},
                {field:'other_end',title:"其它",fitColumns:true},
                {field:'examineDescription',title:"审核描述",fitColumns:true}
            ]
        ];

        param.pageNumber = pageNumber;
        param.pageSize = pageSize;
        param.impleProjId = $("#searchImpleProjName option:selected").attr("value");;
        param.developOrg = $("#searchOrgName option:selected").attr("value");
        param.declareSetId = $("#investBatch option:selected").attr("declareSetId");

        var resp = client.callAsJson("investPlanService/queryInvestPlanAlignList", param);
        if (!resp.success) {
            toastr.error(resp.resultMsg);
            return;
        }

        $.each(resp.result.rows, function (i, one) {
            $.each(one.fundDetailVo, function (j, two) {
                if(two.type == "planProjMoney") {
                    one.bu_plan = two.fundBu;
                    one.sheng_plan = two.fundSheng;
                    one.zheng_plan = two.fundGao;
                    one.qi_plan = two.fundQi;
                    one.shi_plan = two.fundShi;
                    one.other_plan = two.fundOther;
                    one.total_plan = two.total;
                } else if(two.type == "implProjMoney") {
                    one.bu_impl = two.fundBu;
                    one.sheng_impl = two.fundSheng;
                    one.zheng_impl = two.fundGao;
                    one.qi_impl = two.fundQi;
                    one.shi_impl = two.fundShi;
                    one.other_impl = two.fundOther;
                    one.total_impl = two.total;
                } else if(two.type == "investPlanMoney") {
                    one.bu_invest = two.fundBu;
                    one.sheng_invest = two.fundSheng;
                    one.zheng_invest = two.fundGao;
                    one.qi_invest = two.fundQi;
                    one.shi_invest = two.fundShi;
                    one.other_invest = two.fundOther;
                    one.total_invest = two.total;
                } else if(two.type == "fundPlanMoney") {
                    one.bu_fund = two.fundBu;
                    one.sheng_fund = two.fundSheng;
                    one.zheng_fund = two.fundGao;
                    one.qi_fund = two.fundQi;
                    one.shi_fund = two.fundShi;
                    one.other_fund = two.fundOther;
                    one.total_fund = two.total;
                } else if(two.type == "fundWriteMoney") {
                    one.bu_write = two.fundBu;
                    one.sheng_write = two.fundSheng;
                    one.zheng_write = two.fundGao;
                    one.qi_write = two.fundQi;
                    one.shi_write = two.fundShi;
                    one.other_write = two.fundOther;
                    one.total_write = two.total;
                } else if(two.type == "fundFirstMoney") {
                    one.bu_first = two.fundBu;
                    one.sheng_first = two.fundSheng;
                    one.zheng_first = two.fundGao;
                    one.qi_first = two.fundQi;
                    one.shi_first = two.fundShi;
                    one.other_first = two.fundOther;
                    one.total_first = two.total;
                } else if(two.type == "fundEndMoney") {
                    one.bu_end = two.fundBu;
                    one.sheng_end = two.fundSheng;
                    one.zheng_end = two.fundGao;
                    one.qi_end = two.fundQi;
                    one.shi_end = two.fundShi;
                    one.other_end = two.fundOther;
                    one.total_end = two.total;
                }
            });
        });

        $('#inverstFirstTrialList').datagrid({
            pagination:true,
            nowrap:false,
            fitColumns:true,
            columns:columns,
            data:resp.result,
        });
        var p = $('#inverstFirstTrialList').datagrid('getPager');
        $(p).pagination({
            pageSize: 20,
            pageList: [10,20,30],
            beforePageText: '第',
            afterPageText: '页    共 {pages}  页',
            displayMsg: '当前显示 {from} - {to} 条记录 共 {total}  条记录',
            onSelectPage:function(pageNumber, pageSize){
                _initDataList(pageNumber, pageSize);
            }
        });
    }

    //审核(保存按钮)
    function _saveinverstFirstTrial2(){
        var investPlanId = [];
        $.each($('#inverstFirstTrialList').datagrid('getChecked'), function(index, item){
            investPlanId[index] = item.investPlanId;;
        });

        var saveparam={};
        saveparam.investPlanId = investPlanId;
//        saveparam.operType="1";
        saveparam.examineDescription= $("#examineDescription2").val();
        saveparam.description= $("#examineDescription2").val();
        if($("#examineResult2").val()=="通过")
            saveparam.statusCd=60 ;
        if($("#examineResult2").val()=="不通过")
            saveparam.statusCd=50 ;

        var result = client.callAsJson("investPlanService/batchTrialInvestPlan", saveparam);
        if(result.resultCode=='0'){
            _initDataList(1, 20);
            toastr.success("保存成功！");
            $("#batchEditModal").modal("hide");
        }else {
            toastr.error("服务器忙！请稍后再试！"+result.resultMsg);
        }
    }

    //审核(保存按钮) _saveBtnGreen
    function _saveBtnGreen(){
        var projId = $("#impleProjName option:selected").attr("value");
        var devOrg = $("#orgName option:selected").attr("value");
        var setId = $("#investBatch2 option:selected").attr("declareSetId");

        if (projId == "") {
            toastr.warning("项目不能为空");
            return;
        }
        if (devOrg == "") {
            toastr.warning("建设单位不能为空");
            return;
        }
        if (setId == "") {
            toastr.warning("申报批次不能为空");
            return;
        }

        var saveparam={};
        saveparam.impleProjId = projId;
        saveparam.developOrg = devOrg;
        saveparam.declareSetId = setId;
        saveparam.buFund = $("#bu_end").val();
        saveparam.shengFund= $("#sheng_end").val();
        saveparam.gaoFund= $("#zheng_end").val();
        saveparam.shiFund= $("#shi_end").val();
        saveparam.otherFund= $("#other_end").val();
        saveparam.qiFund= $("#qi_end").val();

        saveparam.remark= $("#examineDescription").val();
        if($("#examineResult2").val()=="通过")
            saveparam.statusCd=60 ;
        if($("#examineResult2").val()=="不通过")
            saveparam.statusCd=50 ;

        var result = client.callAsJson("investPlanService/addInvestPlanGreen", saveparam);
        if(result.resultCode=='0'){
            _initDataList(1, 20);
            toastr.success("保存成功！");
            $("#addEditModal").modal("hide");
        }else {
            toastr.error("服务器忙！请稍后再试！"+result.resultMsg);
        }
    }

    return {
        init : _init,
        modinverstFirstTrial : _modinverstFirstTrial
    }
}();

$(function() {
    com.im.inverstAlign.invoke.init();
});
